home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / science / cdrift3.zip / HOWTORUN.DOC < prev    next >
Text File  |  1990-02-22  |  9KB  |  189 lines

  1. COMPILING AND RUNNING TEC ON THE AMIGA
  2.  
  3. Compile tec1.c, tec2.c, tec3.c and ami.c.  I have Lattice C 4.0
  4. and I use lc1 -oram:, lc2 -ccdb -v.  The -ccdb puts the entire
  5. executable into chip ram; this is overkill, but the custom chips have
  6. to be able to get to the graphics structures in ami.c.  Then BLink the
  7. four .o files along with the startup code and the lcm, lc and amiga
  8. libraries (lcm has to be before lc, but you knew that).
  9.  
  10. Tec doesn't need any command line arguments, but if you wish to store
  11. snapshots you should redirect standard output to a file, for example
  12.  
  13. tec >ram:tec.out
  14.  
  15. Each snapshot is about 32K of text.
  16.  
  17. When the program comes up, it opens a 5 bitplane 320 x 200 screen with one
  18. big window.  If you need to see the Workbench screen again you can use
  19. left-amiga-m,n.  After a second or two, a big green blob will pop up.  This
  20. is the initial supercontinent. Every three seconds or so, another "step" will
  21. be computed and drawn.
  22.  
  23. Altitudes are represented by colors; from lowest to highest, these are:
  24. black (ocean), dark blue (deep continental shelf), bright blue (higher
  25. continental shelf), dark green (lowest abovewater elevation), bright green,
  26. dark red, bright red, purple, white, yellow.  There are about 24 visibly
  27. different altitude ranges, since each color has several shades.
  28.  
  29. As time passes, you will see the supercontinent split up; red and purple
  30. mountains will appear on the leading edges of drifting continents; when
  31. continents slow down, reverse course, and collide, high purple and white
  32. mountains will appear.  If you watch carefully, you can see erosion on
  33. mountains that are not growing; they turn dark red and then bright green.
  34.  
  35. At any time, you can click on the close window gadget to kill the program.
  36. It only checks the mouse once per update, so it may take the program a few
  37. seconds to notice you have killed it.
  38.  
  39. If you click the left mouse button anywhere but on the close gadget, the
  40. program will pause after the next update and write 450 lines of data to
  41. stdout.  If you have not redirected stdout to a file, it takes about two
  42. minutes for it all to come out; redirected to ram:, it takes about 30
  43. seconds.  The program obviously will not do anything else during this time.
  44. Typing ctrl-C will bring up a Lattice requester asking if you want to abort;
  45. I don't advise this, because the abort does not close the window and screen.
  46.  
  47.  
  48. COMPILING AND RUNNING TEC ON A UN*X PLATFORM
  49.  
  50. Type "cc -o tec tec?.c unix.c -lm" to create an executable called tec.
  51. Tec doesn't need any command line arguments and prints all its output
  52. to stdout.  To do almost anything interesting, you will have to adjust
  53. the parameters, as explained in the file params.doc.
  54.  
  55.  
  56. COMPILING AND RUNNING TEC UNDER SUNVIEW
  57.  
  58. Type "cc -o tec tec?.c sun.c -lsuntool -lsunwindow -lpixrect -lm" to make
  59. an executable called tec.  A canvas subwindow is opened; every second or so
  60. another step will be displayed.  On the Sparcstation several steps are
  61. displayed per second.  The colors displayed are identical to those
  62. used in the Amiga version.  Use the Sunview menu to exit the program.  I
  63. am using the simplest Sunview interface scheme, and you have to hold the
  64. mouse button down for a couple of seconds to get the menu.  Currently it is
  65. not possible to tell the Sunview version of tec to print output; use the
  66. Un*x version for that.
  67.  
  68.  
  69. COMPILING AND RUNNING TEC ON AN IBM PC/XT/AT OR 100% COMPATIBLE (TURBO C 2.00+)
  70. (This section by Peter Lind)
  71.  
  72. Suggested Compiler Configuration
  73. The following compiler options are recommended to yield the fastest execution
  74. speed. Any or all may be changed as the user sees fit. On 80x86 machines (as
  75. opposed to the 8088), enabling word-boundary alignment will increase speed.
  76. On 80186/80286 machines, enabling the extended instruction set will also yield
  77. a speed-up. If an 80x87 is available, enable generation of 80x87 code. Finally,
  78. for best results, disable all debugging-oriented options.
  79.  
  80.     Memory Model    : Compact (or Large or Huge).
  81.     Optimization    : Optimize for speed
  82.                       Use of registers      ON
  83.                       Register optimization ON
  84.                       Jump optimization     ON
  85.  
  86. Option 1 -- Integrated Environment
  87. Create a file called TEC.PRJ containing the lines 'tec1.c', 'tec2.c',
  88. 'tec3.c', 'ibmpc.c'.  Set the Project name to TEC.PRJ and press F9 to make.
  89. The resulting file will be called TEC.EXE. Ignore the warnings produced.
  90.  
  91. Option 2 -- Command Line Make
  92. Read through the comments in the make file TEC.MAK; the macro directory
  93. names may have to be changed to conform with your system; also, there are
  94. certain macros that can be changed to compile TEC for an 80186/80286
  95. and/or an 80x87.
  96.  
  97. Run the Turbo C MAKE utility with the command line: make -ftec.mak
  98. The included makefile TEC.MAK uses the command line options listed below;
  99. either of these may be changed to suit the user's preference:
  100.         -mc        Compact memory model
  101.         -G         Optimize for speed
  102.         -w-        Suppress warnings
  103.         -a         Align to word
  104.  
  105. A Note on Required Files (supplied with Turbo)
  106.  
  107.    i) Either (or both) .BGI files (CGA.BGI and EGAVGA.BGI) must reside in the
  108.       *current* DOS directory (where it is assumed TEC.EXE resides).
  109.  
  110.   ii) If TEC is to be run in EGA/VGA mode, TRIP.CHR should reside in the 
  111.       *current* DOS directory.
  112.  
  113.       If TEC is to be run in CGA/MCGA mode, LITT.CHR should reside in the 
  114.       *current* DOS directory.
  115.  
  116.  iii) If the programmer wants to execute TEC via the DOS search path, then
  117.       modifications will have to be made to IBMPC.C, and (sorry, but) the
  118.       programmer is on his/her own since this problem is not straightforward
  119.       and could be solved in a variety of ways (most simple of which would be
  120.       to place the *exact* DOS path in double quotes as the third parameter
  121.       to grafinit() in IBMPC.C).
  122.  
  123.  
  124. Running the Program
  125.  
  126. The IBM PC version of TEC will run under CGA, MCGA, EGA or VGA graphics,
  127. auto-detecting the graphics hardware and choosing the mode with highest
  128. resolution. Since CGA and MCGA hi-res modes provide only two colors (black
  129. and white), a rudimentary 3-D plotting facility is provided to take the
  130. place of the standard multi-colored plotting. In EGA or VGA, the user may
  131. switch between the multi-colored and 3-D modes as desired. The 3-D facility
  132. is rather sluggish, but produces interesting plots; it can be run in either
  133. "fast" or "slow". In slow mode, each "pixel" of the plate tectonics is drawn
  134. as a 3-D block. In fast mode, all "pixels" in the same row with the same height
  135. are merged and plotted as a wide "slab". The fast mode is faster, but the plot
  136. produced does not look as good as that generated by the slow mode.
  137.  
  138. When TEC.EXE is run, the introductory credits panel will first be displayed;
  139. press any key to cause the program to continue. A window will then be drawn on
  140. the screen with a title bar along the top and a message line along the bottom.
  141. The program will display the message "Setting up..." while the initial data
  142. structure preparation is performed. Then, TEC will enter its main loop that
  143. repeatedly generates one "time step" and displays the map.
  144.  
  145. a) Thinking Phase: TEC displays the message "Thinking..." while generating the
  146.    next step. While TEC is "thinking", the user may press a key:
  147.  
  148.         ESC        Abort to DOS when finished thinking
  149.        SPACE       Pause after plotting until any key pressed
  150.        p or P      Print (Generic, Text or Postscript)
  151.        g or G      Change plotting style (Standard, Slow 3-D, Fast 3-D)
  152.  
  153.    TEC will respond to the key press when it finishes thinking.
  154.  
  155. b) Plotting Phase: When finished thinking, and provided that the user did not
  156.    abort the program, TEC will display the message "Plotting..." and begin
  157.    plotting the current step. In CGA/MCGA, the plotting is always monochromatic
  158.    simulated 3-D. In EGA/VGA, TEC displays different altitudes in different
  159.    colors. From lowest to highest, these are: black (ocean), dark blue (deep
  160.    continental shelf), light blue (higher continental shelf), dark green
  161.    (lowest abovewater elevation), light green, yellow, magenta, light magenta,
  162.    dark red, light red, brown, light gray, and white. There are 13 visibly
  163.    different altitude ranges.
  164.  
  165.    The following keys are recognized while plotting:
  166.  
  167.         ESC        Abort to DOS immediately
  168.          CR        Skip current plot (immediately start next thinking phase)
  169.        p or P      Print (Generic, Text or Postscript) when done plotting
  170.        g or G      Change plotting style (Standard, Slow 3D, Fast 3D)
  171.  
  172.    If `p' (or `P') is pressed, the print operation will start after the plot is
  173.    completed. Note that printing will not proceed unless stdout was redirected
  174.    on the command line, as in:
  175.  
  176.           TEC >TEC.OUT
  177.  
  178.  
  179.    The action that TEC takes when `g' (or `G') is pressed depends on the
  180.    graphics mode:
  181.  
  182.       (i)  If TEC is running under CGA or MCGA, the user is able to switch
  183.            immediately between fast or slow 3-D plotting (but is unable to
  184.            switch to standard, color plotting).
  185.  
  186.       (ii) If TEC is running under EGA or VGA, the command is deferred
  187.            until the plot is finished (as the plot cannot be restarted).
  188.  
  189.